<?php
require_once('smtp.class.php');
$mail=new smtp_class; 

# email setting 
$mail->Host            = "221.231.137.190";  // SMTP server. like smtp.21cn.com
$mail->Port            = 25;  // SMTP port. Default: 25; 
$mail->Timeout        = 10;  // SMTP connection timeout. Default: 10; 
$mail->Timezone        = "+0800";  // Time Zone. Default: "+0000"; 
$mail->Priority        = 3;  // Email priority Default: 3 (1=High,3=Medium or 5=Low); 
$mail->CharSet        = "UTF-8";  // Character set. 
$mail->WordWrap        = 0;  // characters per line. 0 for umlimit characterc per line 
$mail->IsHTML        = true;  // HTML email. Default: false (true or false); 
$mail->MailerDebug    = true;  // Display SMTP error. Default: false (true or false); 
$mail->AuthLogin    = true;  // using SMTP authorization. Default: false (true or false); 
$mail->AuthUser        = "autopost@yoho.cn";  // SMTP username 
$mail->AuthPass        = "newpowers";  // SMTP password 


# email address and content start here 
$mail->From("autopost@yoho.cn","dan"); 
$mail->AddTo("danvan8511@hotmail.com","dan"); 
//$mail->AddCc("Email","Name"); 
//$mail->AddBcc("Email","Name"); 
$mail->AddReplyTo("yoho@yoho.cn","Name"); 
$mail->Subject="hihi"; 
$mail->Body="<meta http-equiv=Content-Type content=text/html; charset=UTF-8 />
<style type=text/css>
<!--
body,td {
	font-size: 12px;
	color: #333333;
	line-height: 160%;

}
.title1 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	line-height: 200%;
	font-weight: normal;
	color: #576479;
}
-->
</style>
<p></p>
<table width=98% border=0 cellspacing=0 cellpadding=0>
  <tr>
    <td width=11%>Name:</td>
    <td width=89%>我的名字</td>
  </tr>
  <tr>
    <td>Email:</td>
    <td>我的邮件psdshow@yahoo.com.cn</td>
  </tr>
  <tr>
    <td>Subject:</td>
    <td>我的主题</td>
  </tr>
  <tr>
    <td>Message:</td>
    <td>我的信息</td>
  </tr>
</table>"; 


# add attachment 
//$mail->AddAttachment("filename.ext"); 


# define attachment content 
//$mail->AddAttachmentContent("attachment content","attachment_filename.ext"); 


# check email success or fail with your own program 
if(!$mail->SMTP_open($mail->Host,$mail->Port,$mail->Timeout)){
	$this->error_handler("SMTP Error: SMTP Connection Fail.");
	return;
}
if(!$mail->Send()){ 
     echo "<br><br><br><br><br><div align=center>Email Fail</div><meta http-equiv='refresh' content='1;url=index.php'>"; 
}else{ 
    echo "<br><br><br><br><br><div align=center>Email Success</div><meta http-equiv='refresh' content='1;url=index.php'>"; 
}

sleep(30);
if(!$mail->Send()){ 
     echo "<br><br><br><br><br><div align=center>Email Fail</div><meta http-equiv='refresh' content='1;url=index.php'>"; 
}else{ 
    echo "<br><br><br><br><br><div align=center>Email Success</div><meta http-equiv='refresh' content='1;url=index.php'>"; 
}
 
$mail->SMTP_close();
?>